<template>
	<view class="background-image" style="" :style='[bgStyle]'></view>
</template>

<script lang="ts">
export default {
	props: {
		bgimg: {
			type: String,
			required: true
		},
		mstyle: {
			type: Object,
			default: () => ({}),
		}
	},
	data() {
		return {
			bgStyle: {}
		};
	},
	created() {
		Object.assign(this.bgStyle, this.mstyle || {}, {
			backgroundImage: 'url(' + this.bgimg + ')'
		});
	}
}
</script>

<style lang="scss" scoped>
m-show-bgimg {
	width: 100%;
	height: 100%;
}

.background-image {
	width: 100%;
	height: 100%;
	background-size: cover;
	background-repeat: no-repeat;
	background-position: center;
}
</style>